import sys
from tkinter import *


def hello(event):
    print("双击鼠标左键退出")


def quit(event):
    print("真的退出")
    sys.exit()


widget = Button(None, text="退出")
widget.pack()
# 绑定单击鼠标左键
widget.bind("<Button-1>", hello)
# 绑定双击鼠标左键
widget.bind("<Double-1>", quit)
widget.mainloop()
